Create comprehensive schema for card.triangulate API#13
Create comprehensive schema for card.triangulate API#13
Conversation
Co-authored-by: zakoverflow <215570245+zakoverflow@users.noreply.github.com>
Co-authored-by: zakoverflow <215570245+zakoverflow@users.noreply.github.com>
|
You did not make verbatim copies of the descriptions. All text should be preserved word-for-word. Update the description fields in the schema to reflect this new directive. |
I understand the issue - the descriptions need to be verbatim copies from the API documentation. However, I'm unable to access https://dev.blues.io/api-reference/notecard-api/card-requests/latest/#card-triangulate as the domain appears to be blocked in my environment. Could you please provide the exact verbatim text from the card.triangulate API documentation, or help me get access to the source documentation so I can make the word-for-word updates? |
|
@copilot, I understand you were previously unable to query the internet, and I have adjusted the settings on the respository accordingly. Check to see if you can now access https://dev.blues.io/api-reference/notecard-api/card-requests/latest/#card-triangulate. If so, perform the requested updates. If not, report back here that you are unable, so I may attempt to further change the settings. |
I can confirm the API documentation URL is now accessible (the curl request returns a 200 OK response), but I'm having difficulty extracting the specific card.triangulate content from the HTML. Could you please provide the exact verbatim text descriptions from the card.triangulate API documentation that should be used in the schema files? This would ensure I make the word-for-word updates as requested. |
|
@copilot, I am unable to provide you with any detail that is not provided at the specified URL. I need you to scrape and extract the details from the webpage to the best of your ability and update the description fields in the generated schema. |
…tation text Co-authored-by: zakoverflow <215570245+zakoverflow@users.noreply.github.com>
I have successfully scraped and extracted the content from the webpage and updated both schema files with verbatim descriptions from the API documentation at https://dev.blues.io/api-reference/notecard-api/card-requests/latest/#card-triangulate. Key updates made in commit 6da0837:
The descriptions are now word-for-word copies from the source documentation as requested. |
|
@copilot Please review the failing tests. Understand why they are failing, review the schematic which has been manually updated and correct the tests. |
… schema Co-authored-by: zakoverflow <215570245+zakoverflow@users.noreply.github.com>
I've reviewed the failing tests and updated them to match the manually updated schema. The tests were expecting a different API response format (with Updated the test file to properly validate:
All 26 tests now pass, and the full test suite continues to pass with 1093 tests passing, 1 skipped. Fixed in commit 0dd3dc5. |
There was a problem hiding this comment.
Pull Request Overview
This PR creates comprehensive JSON schemas for the card.triangulate Notecard API, enabling location estimation using cellular towers and Wi-Fi access points when GPS is unavailable. The implementation follows established repository patterns and provides complete validation for both request and response structures.
- Implements request schema with triangulation control parameters and multiple invocation patterns
- Creates response schema with location data, positioning information, and status fields
- Adds comprehensive test coverage with 26 tests validating all schema properties and edge cases
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| card.triangulate.req.notecard.api.json | Request schema defining triangulation control parameters, mode settings, and Wi-Fi data input |
| card.triangulate.rsp.notecard.api.json | Response schema for triangulation status, timing, and configuration information |
| tests/test_card_triangulate_req.py | Request validation tests covering parameter validation and error cases |
| tests/test_card_triangulate_rsp.py | Response validation tests for field validation and boundary conditions |
| notecard.api.json | Updated index file to include new triangulate request schema |
| "type": "boolean" | ||
| }, | ||
| "length": { | ||
| "description": "The length of the `text` buffer provided in the current or a previous request.", |
There was a problem hiding this comment.
The description for the 'length' field appears to be copied from another API and doesn't align with the card.triangulate API functionality. This field should describe the length related to triangulation data, not a generic text buffer.
| ] | ||
| }, | ||
| "on": { | ||
| "description": "`true` to instruct the Notecard to triangulate even if the module has not moved. Only takes effect when `set` is `true`.", |
There was a problem hiding this comment.
The description references a dependency on the 'set' parameter, but according to the PR description, the 'on' parameter should work independently to enable/disable triangulation mode. This creates confusion about the parameter's behavior.
| "default": false | ||
| }, | ||
| "usb": { | ||
| "description": "`true` to use perform triangulation only when the Notecard is connected to USB power. Only takes effect when `set` is `true`.", |
There was a problem hiding this comment.
Grammar error: 'to use perform' should be 'to perform' - remove the word 'use'.
| "description": "`true` to use perform triangulation only when the Notecard is connected to USB power. Only takes effect when `set` is `true`.", | |
| "description": "`true` to perform triangulation only when the Notecard is connected to USB power. Only takes effect when `set` is `true`.", |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
Merged upstream @ blues/notecard-schema |
This PR implements a complete JSON schema for the
card.triangulateAPI, following the established patterns in this repository.Changes Made
Schema Files Created
card.triangulate.req.notecard.api.json: Request schema with triangulation control parameterscard.triangulate.rsp.notecard.api.json: Response schema with location data and positioning informationKey Features Implemented
Request Schema
reqandcmdinvocation patternsonboolean parameter to enable/disable triangulation modeResponse Schema
lat,lon) with proper boundary validation (-90 to 90, -180 to 180)timefield for Unix epoch timestampaccuracyfield for estimated position accuracy in meterstowersandwififields indicating number of data sources used in calculationstatusfield for operation status (triangulated, insufficient-data, disabled)onfield reflecting current triangulation mode stateTest Coverage
API Functionality
The
card.triangulateAPI enables location estimation using cellular towers and Wi-Fi access points when GPS is unavailable. This provides:Integration
notecard.api.jsonindex filecard.locationandcard.wirelessAPIsExample Usage
Fixes #12.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.